text: Fix popover use
authorMatthias Clasen <mclasen@redhat.com>
Fri, 8 May 2020 04:25:47 +0000 (00:25 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 12 May 2020 02:21:39 +0000 (22:21 -0400)
There were some leftover gtk_container_add calls here
on popovers on buttons, but these are no longer containers.

gtk/gtktext.c

index cad6044f429ac470b88aad1e36e08ff7774da80e..377be4a19292a6482d0f40b39bd47474b1cb0c84 100644 (file)
@@ -2003,8 +2003,7 @@ gtk_text_ensure_magnifier (GtkText *self)
   gtk_widget_set_parent (priv->magnifier_popover, GTK_WIDGET (self));
   gtk_widget_add_css_class (priv->magnifier_popover, "magnifier");
   gtk_popover_set_autohide (GTK_POPOVER (priv->magnifier_popover), FALSE);
-  gtk_container_add (GTK_CONTAINER (priv->magnifier_popover),
-                     priv->magnifier);
+  gtk_popover_set_child (GTK_POPOVER (priv->magnifier_popover), priv->magnifier);
   gtk_widget_show (priv->magnifier);
 }
 
@@ -6003,7 +6002,7 @@ append_bubble_item (GtkText    *self,
   gtk_widget_set_focus_on_click (item, FALSE);
   image = gtk_image_new_from_icon_name (icon_name);
   gtk_widget_show (image);
-  gtk_container_add (GTK_CONTAINER (item), image);
+  gtk_button_set_child (GTK_BUTTON (item), image);
   gtk_widget_add_css_class (item, "image-button");
   gtk_actionable_set_action_name (GTK_ACTIONABLE (item), action_name);
   gtk_widget_show (GTK_WIDGET (item));
@@ -6054,7 +6053,7 @@ gtk_text_selection_bubble_popup_show (gpointer user_data)
   gtk_widget_show (box);
   toolbar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
   gtk_widget_add_css_class (toolbar, "linked");
-  gtk_container_add (GTK_CONTAINER (priv->selection_bubble), box);
+  gtk_popover_set_child (GTK_POPOVER (priv->selection_bubble), box);
   gtk_container_add (GTK_CONTAINER (box), toolbar);
 
   model = gtk_text_get_menu_model (self);